﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;

using ComLib;
using ComLib.Arguments;
using ComLib.Data;
using ComLib.Application;
using ComLib.Entities;
using ComLib.Models;
using ComLib.LocationSupport;
using ComLib.Extensions;
using ComLib.Samples;
using ComLib.Account;
using ComLib.Web.Modules;
using ComLib.Scheduling;
using ComLib.Exceptions;
using System.Threading;

/*
using ComLib.Web.Modules.Pages;
using ComLib.Web.Modules.Events;
using ComLib.Web.Modules.Links;
using ComLib.Web.Modules.Posts;
/* */

namespace ComLib.Web.Modules
{
    public class ModulesCodeRunner : App
    {
        static void Main(string[] rawArgs)
        {
            App.Run(new ModulesCodeRunner(), rawArgs);
        }


        public override BoolMessageItem Execute(object context)
        {            
            ConnectionInfo conn = new ConnectionInfo("Server=kishore_pc1;Database=testdb1;User=testuser1;Password=password;", "System.Data.SqlClient");
            WebModels models = new WebModels(conn);
            var ctx = models.GetModelContext();
            CodeGeneration.CodeBuilder.CreateAll(ctx, "Config");
            return BoolMessageItem.True;
        }
    }

}
